<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%double_lottery}}".
 *
 * @property integer $issue
 * @property integer $front_1
 * @property integer $front_2
 * @property integer $front_3
 * @property integer $front_4
 * @property integer $front_5
 * @property integer $front_6
 * @property integer $back
 * @property string $date
 */
class DoubleLottery extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%double_lottery}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_finance');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['issue', 'front_1', 'front_2', 'front_3', 'front_4', 'front_5', 'front_6', 'back', 'date'], 'required'],
            [['issue', 'front_1', 'front_2', 'front_3', 'front_4', 'front_5', 'front_6', 'back'], 'integer'],
            [['date'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'issue' => Yii::t('app', '基数'),
            'front_1' => Yii::t('app', '前区1'),
            'front_2' => Yii::t('app', '前区2'),
            'front_3' => Yii::t('app', '前区3'),
            'front_4' => Yii::t('app', '前区4'),
            'front_5' => Yii::t('app', '前区5'),
            'front_6' => Yii::t('app', '前区6'),
            'back' => Yii::t('app', '后区'),
            'date' => Yii::t('app', '开奖日期'),
        ];
    }
}
